/*
 * @Author: lll 1280388921@qq.com
 * @Date: 2025-04-13 21:02:10
 * @LastEditors: lll 1280388921@qq.com
 * @LastEditTime: 2025-04-13 21:50:01
 * @FilePath: /lesson28/client.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include <iostream>
#include"comm.hpp"
using namespace std;

int main()
{
    int fd=open(FIFO_FILE,O_WRONLY);
    if(fd<0)
    {
        perror("open");
        exit(FIFO_OPEN_ERR);
    }

    cout<<"client open file done!"<<endl;

    string line;
    while(1)
    {
        cout<<"Please enter: "<<endl;
        getline(cin,line);

        write(fd,line.c_str(),line.size());
    }

    close(fd);

    return 0;
}